home *** CD-ROM | disk | FTP | other *** search
/ Light ROM 3 / Light ROM 3 - Disc 2.iso / programs / amiga / macromkr / ripplean.lzh / SimpleRipple.fred < prev    next >
Text File  |  1993-10-02  |  2KB  |  121 lines

  1. /*  SimpleRipple.fred
  2.  
  3. ** Clips Imported:
  4. **    FREDPhase     -    Current Phase amount (degrees)
  5. **    FREDPhaseIncrement    -    Phase increment per frame
  6. **
  7. ** Clips Exported:
  8. **    FREDPhase     -    Current Phase amount (degrees)
  9. **    FREDOverrideLength    -    Override Length parameter flag
  10. **                             (if 1, override the Length)
  11. **
  12. ** NOTE: Clip names are case sensitive.
  13. **
  14. ** This script requires FRED v1.2.0 (or higher) to run.  Also required is
  15. ** ADPro v2.0.0 or MorphPlus v1.0.0.
  16. */
  17.  
  18. ADDRESS "ADPro"
  19. OPTIONS RESULTS
  20.  
  21. PARSE ARG FrameNum FrameFName Length LoadFlag FirstCallSeq FirstCallCell
  22.  
  23. NL = '0A'X
  24.  
  25. /*
  26. ** Get the required clips.  Error if any are missing.
  27. */
  28.  
  29. Phase = GETCLIP( "FREDPhase" )
  30. IF (Phase = "") THEN DO
  31.     ADPRO_TO_FRONT
  32.     OKAY1 "Required clip, FREDPhase," || NL ||,
  33.         "is not specified."
  34.     ADPRO_TO_BACK
  35.     EXIT 10
  36. END
  37.  
  38. PhaseIncrement = GETCLIP( "FREDPhaseIncrement" )
  39. IF (PhaseIncrement = "") THEN DO
  40.     ADPRO_TO_FRONT
  41.     OKAY1 "Required clip, FREDPhaseIncrement," || NL ||,
  42.         "is not specified."
  43.     ADPRO_TO_BACK
  44.     EXIT 10
  45. END
  46.  
  47.  
  48. /*
  49. ** See what type of data is loaded in ADPro/MorphPlus.
  50. */
  51.  
  52. IMAGE_TYPE
  53. ImageType = ADPRO_RESULT
  54. IF ( WORD( ImageType, 1 ) = "NONE" ) THEN DO
  55.     ADPRO_TO_FRONT
  56.     OKAY1 "There is currently no image" || NL ||,
  57.         "in ADPro's buffer. An image" || NL ||,
  58.         "is required for this operation."
  59.         ADPRO_TO_BACK
  60.     EXIT 10
  61. END
  62.  
  63. IF (WORD( ImageType, 1 ) = "BITPLANE") THEN DO
  64.     /*
  65.     ** There's no raw data, but there is rendered data.
  66.     ** The user must want us to modify the rendered data.
  67.     */
  68.  
  69.     OPERATOR "RENDERED_TO_RAW"
  70.     IF (RC ~= 0) THEN DO
  71.         ADPRO_TO_FRONT
  72.         OKAY1 "Converting rendered to raw failed."
  73.         ADPRO_TO_BACK
  74.         EXIT 10
  75.     END
  76. END
  77.  
  78.  
  79. /******************************************************************    
  80. The ripple operator. 
  81. ******************************************************************/
  82.  
  83. XSIZE
  84. CenterX = ADPRO_RESULT / 2
  85. YSIZE
  86. CenterY = ADPRO_RESULT / 2
  87.  
  88.     OPERATOR "RIPPLE",
  89.     "CENTER" CenterX CenterY,
  90.     "PROPSPEED" 40,
  91.     "PERIOD" 40,
  92.     "AMPLITUDE" 10,
  93.     "PHASE" Phase,
  94.     "RAMP" 0,
  95.     "LEVELOFF" 0,
  96.     "WAVETYPE" 0,
  97.     "FRAME" 150,
  98.     "NEWWAVE",
  99.  
  100. IF (RC ~= 0) THEN DO
  101.     Why = ADPRO_RESULT
  102.     ADPRO_TO_FRONT
  103.     OKAY1 "The operator RIPPLE" || NL ||,
  104.         "failed to execute." || NL ||,
  105.                 Why
  106.         ADPRO_TO_BACK
  107.     EXIT 10
  108. END
  109.  
  110.     Phase = Phase + PhaseIncrement
  111.     IF Phase > 360 THEN Phase = Phase - 360
  112.  
  113. /*
  114. ** Update the clips.
  115. */
  116.  
  117. SETCLIP( "FREDPhase", Phase )
  118. SETCLIP( "FREDOverrideLength", 1 )
  119.  
  120. EXIT 0
  121.